-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
close API fixed - openSensor with multiple profiles API added #9320
close API fixed - openSensor with multiple profiles API added #9320
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor changes to be done
if (depth_sensor != null) { | ||
List<StreamProfile> sps = depth_sensor.getStreamProfiles(); | ||
StreamProfile sp = sps.get(0); | ||
StreamProfile depth_profile = sps.get(0); | ||
StreamProfile ir_profile = sps.get(0); | ||
|
||
for (StreamProfile sp2 : sps) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sp2 - change to stream_profile
sps - change to stream_profiles
@@ -203,14 +210,40 @@ private void configAndStart() throws Exception { | |||
if (w == 640 && fps == 30 && (sf.compareTo(StreamFormat.Z16) == 0)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check also height (for both profiles)
Log.d(TAG, "ir stream: " + index + ":" + st.name() + ":" + sf.name() + ":" + w + "x" + h + "@" + fps + "HZ"); | ||
|
||
ir_profile = sp2; | ||
ir_profile_found = true; | ||
} | ||
} | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add exception if profiles were not found - or if only one was found, play only this one, and add a toast message on the missing profile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
src/android/jni/sensor.cpp
Outdated
JNIEXPORT void JNICALL | ||
Java_com_intel_realsense_librealsense_Sensor_nOpenMultiple(JNIEnv *env, jclass type, jlong device_handle, | ||
jlongArray profiles_handle, int num_of_profiles) { | ||
// retreiving profiles from array |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo - retrieving
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
ffd33ae
to
07230d5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Tracked by: LRS-132
Using Sensor example, we get (using the new API for getting both depth and infrared profiles from depth sensor):